<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<title>emplist</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" th:href="@{/css/style.css}" />
	</head>
	<body>
		<div id="wrap">
			<div id="top_content"> 
				<div id="header">
					<div id="rightheader">
						<p>
							2009/11/20
							<br />
						</p>
					</div>
					<div id="topheader">
						<h1 id="title">
							<a href="#">main</a>
						</h1>
					</div>
					<div id="navigation">
					</div>
				</div>
				<div id="content">
					<p id="whereami">
					</p>
					<h1>
						Welcome!
						<span th:text="${session.user.username}"/>
					</h1>
					<table class="table">
						<tr class="table_header">
							<td>
								ID
							</td>
							<td>
								Name
							</td>
							<td>
								Salary
							</td>
							<td>
								Age
							</td>
							<td>
								Bir
							</td>
							<td>
								Operation
							</td>
						</tr>
						<!--实现奇偶行变色-->
						<tr th:class="${empStat.odd}?'row1':'row2'" th:each="emp,empStat:${emps}">
							<td>
								<span th:text="${emp.id}"/>
							</td>
							<td>
								<span th:text="${emp.name}"/>
							</td>
							<td>
								<span th:text="${emp.salary}"/>
							</td>
							<td>
								<span th:text="${emp.age}"/>
							</td>
							<td>
								<span th:text="${#dates.format(emp.bir,'yyyy-MM-dd')}"/>
							</td>
							<td>
								<a th:href="@{/emp/delete(id=${emp.id})}" onclick="return confirm('Are you sure you want to delete it？')">delete emp</a>&nbsp;
								<a th:href="@{/emp/find(id=${emp.id})}">update emp</a>
							</td>
						</tr>
					</table>
					<p>
						<input type="button" class="button" value="Add Employee" onclick="location='/toSave'"/>
					</p>
				</div>
			</div>
			<div id="footer">
				<div id="footer_bg">
				ABC@126.com
				</div>
			</div>
		</div>
	</body>
</html>
